/*
func function_name( [parameter list] ) [return_types] {
   函数体
}
*/
package main

import "fmt"

func main() {
	var a = 100
	var b = 200
	var ret int
	ret = max(a, b)
	fmt.Printf("最大值是：%d", ret)
	x, y := swap("hello", "world")
	println(x, y)
}

/* 返回最大值 */
func max(num1, num2 int) int {
	var result int
	if num1 > num2 {
		result = num1
	} else {
		result = num2
	}
	return result
}

/* 交换值 */
func swap(x, y string) (string, string) {
	return y, x
}
